<?php

namespace app\controller\admin;

use app\result\UeditorResult;
use app\result\UploadResult;
use think\App;

/**
 * 上传
 */
class Upload extends BaseAdmin
{
    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->objResult = new UploadResult();
    }

    //图片上传
    public function image()
    {
        data_exit_json($this->objResult->image());
    }

    //图片上传
    public function file()
    {
        data_exit_json($this->objResult->file());
    }

    /**
     * 文件分片上传
     * @return void
     */
    public function chunk()
    {
        data_exit_json($this->objResult->chunk());
    }

    public function list_group()
    {
        data_exit_json($this->objResult->list_group());
    }

    public function list()
    {
        data_exit_json($this->objResult->list($this->param));
    }

    public function get()
    {
        data_exit_json($this->objResult->get($this->param));
    }

    //删除
    public function del_data()
    {
        data_exit_json($this->objResult->del_data($this->param));
    }

    /**
     * 百度富文本编辑器TP版
     * @email wei@alipay168.cn
     * @author 小韦
     * @link http://blog.alipay168.cn
     * @Date: 2020/4/6 11:32
     */
    function ueditor()
    {
        data_exit_json((new UeditorResult())->ueditor($this->param));
    }

}
